FROM  openjdk:8u201-alpine
WORKDIR /app

COPY target/*.jar  .
RUN cp *.jar /app.jar
#app下面有target目录
RUN cd /app &&  pwd && ls -l

#FROM openjdk:8u282-slim
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
LABEL maintainer="yehui"
# docker run -e JAVA_OPTS="-Xmx512m -Xms33 -" -e PARAMS="--spring.profiles=dev --server.port=8080" -jar /app/app.jar

#启动java的命令
ENV JAVA_OPTS=""
ENV PARAMS=""
ENTRYPOINT [ "sh", "-c", "java -Djava.security.egd=file:/dev/./urandom $JAVA_OPTS -jar /app.jar $PARAMS" ]
#ENTRYPOINT [ "java","-jar" ,"app.jar"]